<!DOCTYPE html>
<html>

<head>
    <title>清除父元素塌陷</title>
    <meta charset="utf-8">
    <style>
        .box {
            border: 1px solid rgb(255, 60, 0);
            zoom: 1;
        }
        .box:after {
            content: "..";
            height: 0;
            display: block;
            visibility: hidden;
            clear: both;
        }
        .left,
        .right {
            width: 100px;
            height: 100px;
            border: 1px solid #388bff;
            float: left;
        }
    </style>
</head>

<body>
    <div class="box">
        <div class="left"></div>
        <div class="right"></div>
    </div>
</body>

</html>